﻿using Abp.Application.Services.Dto;
using Abp.AutoMapper;
using AutoMapper;
using FwProject.ShoppingMall.Config;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace FwProject.Com.Dto
{
    [AutoMapFrom(typeof(Region))]
    public class RegionDto:EntityDto<string>
    {
        [Display(Name = "上级地区")]
        [MaxLength(Region.MaxIdLength, ErrorMessage = "不能超过{1}个字符")]
        public string ParentId { get; set; }

        [Display(Name = "名称")]
        [Required(ErrorMessage = "{0}不能为空")]
        [MaxLength(Region.MaxNameLength, ErrorMessage = "不能超过{1}个字符")]
        public string Name { get; set; }
        
        public string Spell { get; set; }
        
        public string Initial { get; set; }

        [Display(Name = "电话区号")]
        [MaxLength(Region.MaxCodeLength, ErrorMessage = "不能超过{1}个字符")]
        public string Code { get; set; }

        [Display(Name = "邮编")]
        [MaxLength(Region.MaxZipLength, ErrorMessage = "不能超过{1}个字符")]
        public string Zip { get; set; }

        [Display(Name = "等级")]
        public int Level { get; set; }

        [Display(Name = "排序")]
        public int Orderlist { get; set; }


        [IgnoreMap]
        public string ParentName { get; set; }
        [IgnoreMap]
        public List<RegionDto> Childs { get; set; }
    }
}
